Skip to content

feat(datasets): add PaginatedAPIDataset - #1482

Open
Shizoqua wants to merge 5 commits into
kedro-org:mainfrom
Shizoqua:feat/paginated-api-dataset
Open

feat(datasets): add PaginatedAPIDataset#1482
Shizoqua wants to merge 5 commits into
kedro-org:mainfrom
Shizoqua:feat/paginated-api-dataset

Conversation

@Shizoqua

@Shizoqua Shizoqua commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

APIDataset does not provide a way to retrieve and combine data spread across multiple API pages. This PR adds a maintained JSON pagination dataset for APIs that return a next-page URL and a list of results.

fixes #1023

Development notes

  • Added PaginatedAPIDataset, exported from kedro_datasets.api.
  • Supports dotted next_url_path and results_path configuration.
  • Aggregates results in page order into a single list.
  • Preserves authentication, headers, timeout, and other request options.
  • Handles missing results, malformed responses, HTTP errors, repeated URLs, and configurable max_pages.
  • Added documentation and updated catalog schemas.
  • Added mocked pagination tests; all 104 API tests, doctests, Black, Ruff, and mypy checks passed.

Developer Certificate of Origin

Signed off

Checklist

  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Updated jsonschema/kedro-catalog-X.XX.json if necessary
  • Added a description of this change in the relevant RELEASE.md file
  • Added tests to cover my changes
  • Received approvals from at least half of the TSC (required for adding a new, non-experimental dataset)

@ElenaKhaustova

Copy link
Copy Markdown
Contributor

Thank you for your interest in contributing to Kedro!

We appreciate the effort, but we can only accept contributions for issues listed on our open source ticket board: OS contribution tasks. Other issues in the repository are not yet ready for external contribution — they may need further scoping or are marked for internal work.

If you'd like to work on something that isn't on the board, please reach out to us via Slack (https://slack.kedro.org/) or open a GitHub issue to discuss it first. This helps us align on the approach and gives your contribution the best chance of being accepted.

For more details, please see our contribution guidelines: https://github.com/kedro-org/kedro/blob/main/CONTRIBUTING.md and the developer guide: https://github.com/kedro-org/kedro/wiki/Guidelines-for-contributing-developers.

We're closing this PR for now, but we'd love to see you contribute to one of the issues on the board!

@Shizoqua

Shizoqua commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Hi @ElenaKhaustova, I think I found the issue — it was my mistake. I forgot to add the issue to the PR description. This PR is based on issue #1023, which I also picked from the project board.

Sorry about the confusion! Could you please open both PR's (#1481 and #1482) for review when you have a chance?

@merelcht

Copy link
Copy Markdown
Member

Thanks for referencing the issue @Shizoqua, re-opening this for review.

@merelcht merelcht reopened this Aug 12, 2026
@merelcht
merelcht requested review from SajidAlamQB and jitu5 August 12, 2026 13:20
@SajidAlamQB

Copy link
Copy Markdown
Contributor

Thanks @Shizoqua the pagination loop looks good can you update RELEASE.md

Also flagging that a new non-experimental dataset needs TSC sign-off we'll discuss whether this should start in kedro_datasets_experimental or become an option on APIDataset itself.

Comment thread kedro-datasets/kedro_datasets/api/api_dataset.py Outdated
Comment thread kedro-datasets/kedro_datasets/api/api_dataset.py Outdated
@Shizoqua

Shizoqua commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback guys @SajidAlamQB @jitu5 . I’ve updated the example to use credentials, added same-host pagination with opt-in allowed_hosts, and covered the security and regression cases with tests. Schemas, docs, and release notes are updated, and the API tests pass.

@Shizoqua
Shizoqua force-pushed the feat/paginated-api-dataset branch from f412067 to e441eda Compare August 25, 2026 19:29
Comment thread kedro-datasets/RELEASE.md Outdated
@ravi-kumar-pilla

Copy link
Copy Markdown
Contributor

Hi @Shizoqua,

Thanks for the contribution. Since this adds a new non-experimental dataset, it will need sign off from at least half of the TSC before we can merge.

A few things to address before merge:

Critical

kedro-datasets/RELEASE.md: the entry was added under # Release 9.6.0 instead of # Upcoming release. Could you move it to the upcoming section at the top?

Suggestions

  • The docstring could call out more clearly that only absolute next-page URLs are supported. Many APIs return relative links like /api/items?page=2, which this dataset will reject.
  • _exists() only checks the first page, which is probably fine for v1, but worth a short note in the docs so users know it means "first page responds OK", not "full paginated fetch succeeds".

Overall the implementation looks solid and the earlier review feedback on credentials, host trust, and release notes seems addressed. Once the RELEASE placement is fixed and we have TSC alignment on dataset placement, this should be in good shape.

Thanks again!

Signed-off-by: shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: shizoqua <hr.lanreshittu@yahoo.com>
…edAPIDataset

Signed-off-by: shizoqua <hr.lanreshittu@yahoo.com>
@Shizoqua
Shizoqua force-pushed the feat/paginated-api-dataset branch from 540ec6d to b3b099e Compare September 2, 2026 11:42
@Shizoqua

Shizoqua commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Hi @ravi-kumar-pilla Thanks for the review! Pushed fixes:

  • Moved RELEASE.md entry to "Upcoming release"
  • Added docstring notes on absolute-URL-only requirement and _exists() first-page scope
  • Rebased on main + signed off all commits for DCO

Let me know if anything else needs adjusting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add PaginatedAPIDataSet to kedro-datasets

6 participants